package edu.gdkm.factory;

import org.junit.Test;

public class ToyTest {
    @Test
    public void test1() {
        Toy toy = new Toy();
        toy.setName("dog");
        toy.setCode("9527");
        System.out.println(toy);
        Toy toy2 = new Toy();
        toy2.setName("dog1");
        toy2.setCode("9527");
        System.out.println(toy2);
        Toy toy3 = ToyFactory.createToy("dog3");
        System.out.println(toy3);
        Toy toy4 = ToyFactory.createToy("dog4");
        System.out.println(toy4);
        Toy toy5 = ToyFactory.createToy("dog5");
        System.out.println(toy5);
        ToyFactory2 factory2 = new ToyFactory2();
        Toy toy6 = factory2.createToy("dog6");
        System.out.println(toy6);
        Toy[] toys = new Toy[10];

        for (int i = 0; i < 10; i++) {
            toys[i]=ToyFactory.createToy("dog");
        }
        for (int i = 0; i < 10; i++) {
            System.out.println(toys[i]);
        }

    }
}
